<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="embroot.css">
<TITLE>
Communication via ECLiPSe Streams
</TITLE>
</HEAD>
<BODY >
<A HREF="embroot081.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="embroot073.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="embroot083.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H2 CLASS="section"><A NAME="htoc147">C.9</A>&nbsp;&nbsp;Communication via ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> Streams</H2>
These functions allow exchanging data with an embedded ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> via
queue streams created by the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> code.
Queue streams can be created either by using
<A HREF="../bips/kernel/iostream/open-3.html"><B>open/3</B></A><A NAME="@default400"></A> and
<A HREF="../bips/kernel/iostream/open-4.html"><B>open/4</B></A><A NAME="@default401"></A>
from within
ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> code, or by initializing ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> with the MEMORY_IO option.
In the latter case, the streams 0, 1 and 2 are queues corresponding
to ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP>'s input, output and error streams.
<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description">
<B>int		ec_queue_write(int stream, char *data, int size)</B><DD CLASS="dd-description"><BR>
	Write string data into the specified ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> queue stream.
	Data points to the data and size is the number of bytes to write.
	The return value is 0 for success, or a negative error number.<BR>
<BR>
<DT CLASS="dt-description"><B>int		ec_queue_read(int stream, char *buf, int size)</B><DD CLASS="dd-description"><BR>
	Read string data into the specified ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> queue stream.
	Buf points to a data buffer and size is the buffer size.
	The return value is either a negative error code, or the number
	of bytes read into buffer.<BR>
<BR>
<DT CLASS="dt-description"><B>int		ec_queue_avail(int stream)</B><DD CLASS="dd-description"><BR>
	Determines the number of bytes that are available and can be
	read from the given queue stream. The return value is either
	that number or a negative error code.<BR>
<BR>
<DT CLASS="dt-description"><B>int		ec_stream_nr(char *name)</B><DD CLASS="dd-description"><BR>
	Get the stream number of the named stream. If the return value
	is negative then there is no open stream with the specified name.
 This is the same operation that the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> built-in
 <A HREF="../bips/kernel/iostream/get_stream-2.html"><B>get_stream/2</B></A><A NAME="@default402"></A>
 performs). 
</DL>
<HR>
<A HREF="embroot081.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="embroot073.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="embroot083.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
